<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateChaptersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('chapters', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('article_id')->comment('图文');
            $table->integer('category_id')->comment('分类id');
            $table->integer('type')->comment('分类');
            $table->string('name')->comment('章节名称');
            $table->string('description')->comment('简介');
            $table->string('content')->comment('内容');
            $table->char('status', 11)->default(1)->comment('状态0:删除1:待审核2:审核通过');
            $table->char('sort', 11)->default(1)->comment('排序');
            $table->string('imgs')->nullable()->comment('图片');
            $table->string('videos')->nullable()->comment('视频');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('chapters');
    }
}
